<script src="/include/calendar/calendar.js"></script>
<style type="text/css">
#search-form input,#search-form select {
	width: 128px;
}
</style>
<div class="pageheader">
	<h2>
		<i class="fa fa-pencil-square"></i>日志管理
	</h2>
	<div class="breadcrumb-wrapper">
		<span class="label">你所在的位置：</span>
		<ol class="breadcrumb">
			<li><a href="/index">ERP管理系统</a></li>
			<li>日志管理</li>
			<li class="active">出库日志</li>
		</ol>
	</div>
</div>
<div class="contentpanel">
<div class="main">
    <form id="search-form" class="form-inline" method="get" action="/log/exportcheck" style="margin-bottom: 10px;">
        <div class="form-group">
            <label for="Sku">SKU</label>
            <input type="text" name="sku" value="<?php echo $this->sku;?>" class="form-control">
        </div>
        <div class="form-group">
            <label for="Site">网站</label>
            <select class='form-control' name='site'>
                <option value=''>请选择网站</option>
                <option value='gogoalshop.com'>gogoalshop.com</option>
		        <option value='jerseybbs.com'>jerseybbs.com</option>
		        <option value='goaljerseys.com'>goaljerseys.com</option>
		        <option value='fancybestdeal.com'>fancybestdeal.com</option>
	    	    <option value='elmontyouthsoccer.com'>elmontyouthsoccer.com</option>
		        <option value='bestcheapsoccer.com'>bestcheapsoccer.com</option>
	    	</select>
        </div>
        <div class="form-group">
            <label for="date">日期:</label>
            <input class="form-control" type="text" name="starttime" onclick="new Calendar().show(this);" readonly="readonly" value="<?php echo $this->starttime;?>">
	               至<input class="form-control" type="text" name="endtime" onclick="new Calendar().show(this);" readonly="readonly" value="<?php echo $this->endtime;?>">
        </div>
        <button type="submit" class="btn btn-primary">搜索</button>
        <a style="padding-left: 28px;" href="/log/scanexport">出库扫描</a>
    </form>
    <div class="table-responsive">
        <table class="table table-bordered table-hover">
            <thead>
                <tr>
                    <th>出货单号</th>
                    <th>SKU</th>
                    <th>产品名称</th>
                    <th>尺码和数量</th>
                    <th>网站</th>
                    <th>赠品</th>
                    <th>时间</th>
                    <th>操作人</th>
                </tr>
            </thead>
            <tbody>      
                <?php if ($this->logList):?>
                <?php foreach ($this->logList as $v):?>
                <tr>
                    <td><?php echo $v['bill'];?></td>
                    <td><?php echo $v['sku'];?></td>
                    <td><?php echo $v['title'];?></td>
                    <td>
                        <?php 
                        $i = 0;		 
                        foreach(json_decode($v['info'], true) as $_v){
                        	$act = '';
                        	if ($v['info_stock'] == 'add') {
                        		$act = '+';	
                        	} else {
                        		$act = '-';	
                        	}
                        	echo '尺码: ' . $_v['size'] . ', 库存: ' . $act . stripslashes($_v['value']) . '<br/>';
		                    $i++;
                        }
                        ?>
				    </td>
				    <td><?php echo $v['site'];?></td>
				    <td><?php if($v['isgift']==0){echo '否';}else{echo '是';}; ?></td>
				    <td><?php echo date("Y-m-d H:i:s",$v['add_time']); ?></td>
				    <td><?php echo $v['adduser']; ?></td>
			    </tr>
			    <?php endforeach;?> 
			    <?php endif;?>
			    <tr>
			        <td colspan="8">
			        <?php
					     echo $this->paginationControl ( $this->paginator, 'Sliding', 'page/exportcheckpager.phtml', array (
					     	'billid'=>$this->billid,
					     	'sku'=>$this->sku,
					     	'site'=>$this->site,
						    'starttime' => $this->starttime,
						    'endtime' => $this->endtime 
				    	) );
				    ?>
			        </td>
			    </tr>
		    </tbody>
        </table>
    </div>
</div>
</div>
